/**
 * \file LogFile.h
 * \brief LogFile definition class
 * \author Edouard ROGE
 * \date 12 septembre 2010
 */

#ifndef _LOGFILE_
#define _LOGFILE_

#include <stdio.h>
#include "Core\Pattern\ActiveObject.h"
#include "Logger.h"

namespace Core
{
	namespace Log
	{
		/**
		 * \class LogFile
		 * class used to output logs in a file
		 */
		class LogFile : public Logger
		{
		public:
			/**
			 * \fn LogFile(const char * _filepath);
			 * \param _filepath path of the file to write in
			 * \brief Constructor
			 */
			LogFile(const char * _filepath);

			/**
			 * \fn ~LogFile();
			 * \brief Destructor
			 */
			virtual ~LogFile();

			/**
			 * \fn virtual void	Write(const std::string & _str);
			 * \param _str char buffer to write
			 * \brief Write in file logs
			 */
			virtual void Write(const std::string & _str);

		private:

			/**
			 * \fn void Log(std::string _str);
			 * \param _str char buffer to write
			 * \brief Write in file logs
			 */
			void Log(std::string _str);

			/** Filepath to write in */
			std::string m_strFile;

			/** Active object to log faster */
			ActiveObjectUPtr m_pActiveObject;
		};
	}
}
#endif //_LOGFILE_
